<template>
  <view class="item">
    <view class="left">
      <image :src="item.goods_small_logo || defualtImg" mode=""></image>
    </view>
    <view class="right">
      <view class="title">
        {{item.goods_name}}
      </view>
      <view class="price">
        ¥{{item.goods_price|toFixed}}
      </view>
    </view>
  </view>

</template>

<script>
  export default {
    name: "my-goods",
    props: ['item'],
    data() {
      return {
        defualtImg: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png',
      };
    },
    filters: {
      toFixed(price) {
        return price.toFixed(2)
      }
    }
  }
</script>

<style lang="scss">
  .item {
    display: flex;
    padding: 40rpx 20rpx;
    border-bottom: 1px solid #ccc;

    .left {
      image {
        margin-right: 20rpx;
        width: 200rpx;
        height: 200rpx;
      }
    }

    .right {
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      .title {
        font-size: 12px
      }

      .price {
        font-size: 14px;
        color: #c00000;
      }
    }
  }
</style>
